<?php App::import('Sanitize'); ?>
<div class="welcome">
	<div class="tabs">
		<?php echo $html->link('Updates', array('controller' => 'users', 'action' => 'updates'), array('class'=>'deselected')); ?>
		<span>|&nbsp;</span>
		<?php echo $html->link('Opdrachten', array('controller' => 'pitches', 'action' => 'index'), array('class'=>'deselected')); ?>
		<span>|&nbsp;</span>
		<?php echo $html->link('Vacatures', array('controller' => 'jobs', 'action' => 'index'), array('class'=>'selected')); ?>
	</div>
</div>
				<div class="content-wrapper ui-corner-all">	
				
				<!--               Switch "alle opdrachten & mijn opdrachten"     -->
				<?php if($this->Session->read('Auth.User.group_id') == 1):?>
					<div class="block-white-top ui-corner-tl ui-corner-tr">
					<div class="clear"></div>
						<div class="brief-detail">
							<div class="tabs">
								<?php echo $this->Html->link('Banen', array('controller' => 'jobs', 'action' => 'index', 'job'), array('class' => 'switch-label-vacatures')); ?>
								<?php echo $this->Html->link('Stages', array('controller' => 'jobs', 'action' => 'index', 'internship'), array('class' => 'switch-label-vacatures')); ?>
							</div>
						</div>	
					</div>
					<div class="white-bottom ui-corner-br ui-corner-bl">
					</div>
				<?php endif; ?>	
							
					<div class="block-white-top ui-corner-tl ui-corner-tr">
					
					
					<?php foreach($jobs as $job): ?>
					<div onclick="location.href='<?php echo $this->Html->url(array('controller' => 'jobs', 'action' => 'view', $job['Job']['id']), array('escape' => false)); ?>';" style="cursor: pointer;">
					<div class="clear"></div>
						<div class="brief-detail">
							<div class="logo-conttr">
								<div class="design-kader1">
								<?php if(isset($job['ContractorProfile']['avatar'])) { 
									$image = $job['ContractorProfile']['avatar']; 
									} else {
									$image = 'designs/design.jpg';
									}
								?>
					
							<?php echo $this->Html->link($this->Html->image($image), array('controller' => 'jobs', 'action' => 'view', $job['Job']['id']), array('escape' => false)); ?>
							</div>
							</div>
							
							<div class="briefing-details">
								<h2><?php echo $this->Html->link(Sanitize::html($job['Job']['title']), array('controller' => 'jobs', 'action' => 'view', $job['Job']['id']),array('class'=>'titel')); ?></h2>

								<table>
								<tr>
								<td><p>Bedrijf:</p></td>
								<td><p><?php echo Sanitize::html($job['ContractorProfile']['company']); ?></p></td>
								</tr>
								<tr>
								<td><p>Contract:</p></td>
								<td><p><?php echo Sanitize::html($job['Job']['contract']); ?></p></td>
								</tr>
								</table>
								
						<!--    De regels hieronder zorgen voor een link naar het aantal ontwerpen   -->		
								
								<p><?php /*
								if ($pitch['Pitch']['design_count'] == 1) {
								echo $this->Html->link($pitch['Pitch']['design_count'] . ' ontwerp', array('controller' => 											'designs', 'action' => 'index', $pitch['Pitch']['id']),array('class'=>'aantal_ontwerpen')); } else {
								echo $this->Html->link($pitch['Pitch']['design_count'] . ' ontwerpen', array('controller' => 											'designs', 'action' => 'index', $pitch['Pitch']['id']),array('class'=>'aantal_ontwerpen'));
								}
								
								 */?></p>
																
							</div>
						</div>
						<div class="clear"></div>
						</div>
						<hr/>
						<?php endforeach; ?>
						
					</div>
					
					<div class="white-bottom ui-corner-br ui-corner-bl">
					</div>
				</div>

